//
//  CTAlertView.h
//  CTAlertView
//
//  Created by chentao on 16/5/4.
//  Copyright © 2016年 cmbfae Co.,Ltd. All rights reserved.
//

#import <UIKit/UIKit.h>

#define HEX_RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]


@class CTAlertView;

@protocol CTAlertViewDelegate <NSObject>
@optional
- (void)alertView:(CTAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;

@end

@interface CTAlertView : UIView
@property (weak, nonatomic) UIView *contentView;
@property(nonatomic, strong)UIImage *icon;
@property(nonatomic, copy)NSString *title;
@property(nonatomic, copy)NSString *message;
@property (nonatomic, copy)  NSString *placeholder;
@property(nonatomic, copy)NSMutableAttributedString *attrMessage;
@property (weak, nonatomic) id<CTAlertViewDelegate> delegate;
@property (nonatomic, copy) void (^operation)(NSInteger);
@property (nonatomic, copy) void (^textFieldOperation)(NSInteger,NSString *);
//- (instancetype)initWithTitle:(NSString *)title icon:(UIImage *)icon message:(NSString *)message delegate:(id<CTAlertViewDelegate>)delegate buttonTitles:(NSString *)buttonTitles, ... NS_REQUIRES_NIL_TERMINATION;
/**
 *  init with a NSAttributedString type message
 */
- (instancetype)initWithTitle:(NSString *)title attributeMessage:(NSMutableAttributedString *)attrMessage delegate:(id<CTAlertViewDelegate>)delegate buttonTitles:(NSString *)buttonTitles, ... NS_REQUIRES_NIL_TERMINATION;
/**
 *  init with an nomal NSString type message
 */
- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id<CTAlertViewDelegate>)delegate buttonTitles:(NSString *)buttonTitles, ... NS_REQUIRES_NIL_TERMINATION ;
- (instancetype)initTextFieldWithTitle:(NSString *)title placeholder:(NSString *)placeholder delegate:(id<CTAlertViewDelegate>)delegate buttonTitles:(NSString *)buttonTitles, ... NS_REQUIRES_NIL_TERMINATION ;
//+ (void)showAlertView:(NSString *)message operation:(void (^)(NSInteger clickedIndex))operation;
//+ (void)showAlertView:(NSString *)title message:(NSString *)message operation:(void (^)(NSInteger clickedIndex))operation confirmButtonTitle:(NSString *)confirmButtonTitle cancelButtonTitle:(NSString *)cancelButtonTitle;


- (void)show;
@end
